Django: How do I use assert False, sys.exc_info()[0] without showing a system error page?

Posted by swisstony on Stack Overflow See other posts from Stack Overflow or by swisstony
Published on 2010-05-12T07:10:37Z Indexed on 2010/05/12 7:14 UTC
Read the original article Hit count: 169

I'm new to Django and have some code in my views.py like this:

try:
    myfunction()
except:
    assert False, sys.exc_info()[0]

This is very helpful because I get an email with lots of useful info if there's an error. The problem is that it also redirects the user to a Webfaction system error page. What I'd like to know is how do I still get the useful error email, but redirect the user to my own error page?

Also, is this the best way to be handling errors in Django?

© Stack Overflow or respective owner

Related posts about django

Related posts about assert